﻿using XSTDZ.ERP.Application;
using System.Web.Mvc;
using XSTDZ.ERP.Infrastructure.Authentication;

namespace XSTDZ.ERP.Infrastructure
{
    public  class ApplicationRegister
    {
        public static void Register()
        {
            ApplicationServiceIniter.Instance.AutoMapping();
            ControllerBuilder.Current.SetControllerFactory(new AuthenticationDefaultControllerFactory());   
        }

        public static void RegisteFilter(GlobalFilterCollection filters)
        {
            filters.Add(new XSTDZ.ERP.Infrastructure.Exceptions.CustomException(), 1);//自定义的验证特性
            filters.Add(new HandleErrorAttribute(), 2);
        }
    }
}
